﻿using KTD.Web.BLL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using XXS.Common.ControllerExt;

namespace KTD.Web.Controllers
{
    public class MessageController : Controller
    {
        // GET: Message
        public ActionResult Index()
        {
            return View();
        }

        public ActionResult GetCode(string Mobile)
        {
            try
            {
                if (ManagerFactory.MessageManager.IsMobile(Mobile))
                {
                    ManagerFactory.MessageManager.CreateCode(Mobile);
                }
                return this.JsonNet(new { success = true }, JsonRequestBehavior.AllowGet);
            }
            catch (Exception ex)
            {
                return this.JsonNet(new { success = false, msg = ex.Message }, JsonRequestBehavior.AllowGet);
            }
        }
    }
}